package valoskmdev.bean;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.Text;
import com.google.appengine.api.users.User;

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = "true")
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public class EntityBase implements Serializable {

	private static final long serialVersionUID = -5091149337321179633L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)	
	private Key id;
	@Persistent
	private Date timeCreated;
	@Persistent	
	@Extension(vendorName = "datanucleus", key = "gae.unindexed", value = "true")
	private User userLastModified;
	@Persistent
	private Date timeLastModified;
	@Persistent	
	private Boolean isDisabled;
	@Persistent
	private Text description;
	@Persistent
	private Boolean isPublic;

	public Key getId() {
		return id;
	}

	public void setId(final Key id) {
		this.id = id;
	}

	public Date getTimeCreated() {
		return timeCreated;
	}

	public void setTimeCreated(final Date timeCreated) {
		this.timeCreated = timeCreated;
	}

	public User getUserLastModified() {
		return userLastModified;
	}

	public void setUserLastModified(final User userLastModified) {
		this.userLastModified = userLastModified;
	}

	public Date getTimeLastModified() {
		return timeLastModified;
	}

	public void setTimeLastModified(final Date timeLastModified) {
		this.timeLastModified = timeLastModified;
	}

	public Boolean isDisabled() {
		return isDisabled;
	}

	public Boolean getDisabled() {
		return isDisabled;
	}

	public void setDisabled(final Boolean isDisabled) {
		this.isDisabled = isDisabled;
	}

	public Text getDescription() {
		return description;
	}

	public void setDescription(final Text description) {
		this.description = description;
	}

	public Boolean isPublic() {
		return isPublic;
	}

	public Boolean getPublic() {
		return isPublic;
	}

	public void setPublic(final Boolean isPublic) {
		this.isPublic = isPublic;
	}

}